//
//  ZZProgressHUD.h
//  ZZProgressHUD
//
//  Created by czz on 2018/5/22.
//  Copyright © 2018年 czz. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "ZZProgressHUDShowView.h"
#import "UIImage+ZZ.h"

typedef enum : NSUInteger {
    ShowViewState_Nothing,
    ShowViewState_Loading,
    ShowViewState_LoadingText,
    ShowViewState_Text,
    ShowViewState_Info,
    ShowViewState_Error,
    ShowViewState_Success
} ShowViewState;

@interface ZZProgressHUDModel : NSObject

@property (strong, nonatomic) NSString *text;
@property (assign, nonatomic) NSInteger state;

@end


@interface ZZProgressHUD : NSObject{
    BOOL keyboardIsShow;
    int keyboardHeight;
}

@property (strong, nonatomic) UIView *contentView;
@property (strong, nonatomic) ZZProgressHUDShowView *showView;


/**
 当开始显示时，或者显示状态变更时调用该block
 */
@property (strong, nonatomic) void(^showViewChangedBlock)(ShowViewState state);

/**
 当显示最后一个时调用该block
 */
@property (strong, nonatomic) void(^showLastBlock)(ShowViewState state);

/**
 调用dismiss方法是调用该block
 */
@property (strong, nonatomic) void(^dismissBlock)(void);

@property (assign, nonatomic, readonly) ShowViewState showState;
/**
 是否正在显示
 */
@property (assign, nonatomic) BOOL isShowing;

/**
 是否自动关闭 不适用于loading加载菊花时 默认NO
 */
@property (assign, nonatomic) BOOL isAutomaticClose;
/**
 当很多个提示需要显示时是否排队依次显示
 */
@property (assign, nonatomic) BOOL isLineUpShow;
/**
 当排队显示时的间隔时间 默认1s 需小于dismissInterval
 */
@property (assign, nonatomic) NSTimeInterval lineUpInterval;

/**
 自动关闭窗口间隔时间 默认2s 需大于lineUpInterval
 */
@property (assign, nonatomic) NSTimeInterval dismissInterval;
/**
 在没有加载菊花的时候中间showView最小的尺寸
 */
@property (assign, nonatomic) CGSize showMinSizeWithoutLoading;

/**
 中间showView最小的尺寸
 */
@property (assign, nonatomic) CGSize showMinSize;

/**
 设置之后将改变加载，文字，图片的颜色
 */
@property (strong, nonatomic) UIColor *textColor;

/**
 showView 的背景色样式 默认UIBlurEffectStyleDark
 */
@property (strong, nonatomic) UIBlurEffect *showViewBlurEffect;

/**
 普通提示图片
 */
@property (strong, nonatomic) UIImage *infoImage;

/**
 错误提示图片
 */
@property (strong, nonatomic) UIImage *errorImage;

/**
 成功提示图片
 */
@property (strong, nonatomic) UIImage *successImage;


/**
 初始化
 */
+(ZZProgressHUD *)shareZZProgressHUD;

/**
 关闭窗口
 */
-(void)dismiss;
+(void)dismiss;
/**
 加载菊花 只有菊花
 */
+(void)loading;


/**
 加载菊花并显示提示文字
 */
+(void)loadingWithText:(NSString *)text;

/**
 显示文字 不显示图片 也不显示菊花
 */
+(void)showText:(NSString *)text;

/**
 显示文字 info图
 */
+(void)showInfoWithText:(NSString *)text;
/**
 显示文字 error图
 */
+(void)showErrorWithText:(NSString *)error;
/**
 显示文字 success图
 */
+(void)showSuccessWithText:(NSString *)success;

/**
 键盘通知
 */
- (void)positionHUD:(NSNotification*)notification;

@end
